package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "T_SYS_RIGHT", schema = "oa", catalog = "")
public class RightEntity extends BaseEntity {
    private String url;
    private String name;
    private String description;
    private String parentId;
    private Integer sortNo;
    private Integer rightType; //1、左侧菜单2、我的工作3、报表
    private String imageUrl;//url图片--PC
    private String appImageUrl;
    private Integer defaultFlag;
    private Integer appFlag;
    private Integer bloom;//开放功能


    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public Integer getRightType() {
        return rightType;
    }

    public void setRightType(Integer rightType) {
        this.rightType = rightType;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public Integer getDefaultFlag() {
        return defaultFlag;
    }

    public void setDefaultFlag(Integer defaultFlag) {
        this.defaultFlag = defaultFlag;
    }

    public Integer getAppFlag() {
        return appFlag;
    }

    public void setAppFlag(Integer appFlag) {
        this.appFlag = appFlag;
    }

    public String getAppImageUrl() {
        return appImageUrl;
    }

    public void setAppImageUrl(String appImageUrl) {
        this.appImageUrl = appImageUrl;
    }

    public Integer getBloom() {
        return bloom;
    }

    public void setBloom(Integer bloom) {
        this.bloom = bloom;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        json.put("ID", this.getId());
        json.put("URL", this.getUrl());
        json.put("NAME", this.getName());
        json.put("DESCRIPTION", this.getDescription());
        json.put("PARENT_ID", this.getParentId());
        json.put("SORT_NO", this.getSortNo());
        json.put("RIGHT_TYPE", this.getRightType());
        json.put("DEFAULT_FLAG", this.getDefaultFlag());
        json.put("APP_FLAG", this.getAppFlag());
        json.put("APP_IMAGE_URL", this.getAppImageUrl());
        json.put("IMAGE_URL", this.getImageUrl());
        json.put("BLOOM", this.getBloom());

        return json;
    }

    @Override
    public String getTableName() {
        return "T_SYS_RIGHT";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject json = new JSONObject();
        json.put("ID", "id");
        json.put("URL", "url");
        json.put("NAME", "name");
        json.put("DESCRIPTION", "description");
        json.put("PARENT_ID", "parentId");
        json.put("SORT_NO", "sortNo");
        json.put("RIGHT_TYPE", "rightType");
        json.put("DEFAULT_FLAG", "defaultFlag");
        json.put("APP_FLAG", "appFlag");
        json.put("APP_IMAGE_URL", "appImageUrl");
        json.put("IMAGE_URL", "imageUrl");
        json.put("BLOOM", "bloom");
        return json;
    }
}
